/*
 * Copyright 2009 Colin Prinn
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package net.recursv.motific.at.scene;

import javax.microedition.lcdui.Graphics;

/**
 * Created by: recursv
 * Date: 9/08/2009
 * Time: 8:53:03 AM
 */
public class SceneManager {
    private final static GraphicsWrapper _wrapper = new GraphicsWrapper();
    private static AtScene _scene;

    public static AtScene getScene() {
        return _scene;
    }

    public static GraphicsWrapper lockWrapper(Graphics g) {
        _wrapper.clear();
        _wrapper.setGraphics(g);
        _scene = new NullAtScene();
        return _wrapper;
    }

    public static void unlockWrapper() {
        _scene = new AtScene(_wrapper.getTasks());
    }


}
